//
//  SPGetDeviceDetailValue.m
//  Sampux
//
//  Created by rzm on 16/9/2.
//  Copyright © 2016年 rzm. All rights reserved.
//

#import "SPGetDeviceDetailValue.h"

@implementation SPGetDeviceDetailValue
+ (SampuxListModel *)getDetailData:(GBInterMaster_Bean_DeviceInfo13001 *)device
{
    SampuxListModel *_detailModel = [SampuxListModel alloc];
    _detailModel.nameStr = device.alias;
    _detailModel.accountStr = device.account;
    _detailModel.isOnLine = device.isOnLine;
    _detailModel.isDataSyn = device.isDataSyn;
    _detailModel.workMode = device.workMode;
    _detailModel.heatMode = device.heatMode;
//    _detailModel.workModeSetTime = device.workModeSetTime;
//    _detailModel.heatModeSetTime = device.heatModeSetTime;
    _detailModel.powerSwitch = device.powerSwitch;
//    _detailModel.powerSwitchSetTime = device.powerSwitchSetTime;
    _detailModel.currentSetTempe = device.currentSetTempe;
//    _detailModel.currentSetTempeSetTime = device.currentSetTempeSetTime;
    _detailModel.currentRoomTempe = device.currentRoomTempe;
    _detailModel.currentRoomHumidity = device.currentRoomHumidity;
    _detailModel.isHeat = device.isHeat;
    _detailModel.tempSetLimitTop = device.tempSetLimitTop;
    _detailModel.tempSetLimitLown = device.tempSetLimitLown;
    _detailModel.actionTotalTime = device.actionTotalTime;
    _detailModel.isSiliconControlProtection = device.isSiliconControlProtection;
    _detailModel.isOverTempProtection = device.isOverTempProtection;
    _detailModel.isColdTempProtection = device.isColdTempProtection;
    _detailModel.pragramCurrentPoint = device.pragramCurrentPoint;
    _detailModel.QKHSetTemp = device.QKHSetTemp;
    _detailModel.CFTSetTemp = device.CFTSetTemp;
    _detailModel.ECSetTemp = device.ECSetTemp;
    _detailModel.ProgramSetTemp = device.ProgramSetTemp;
    _detailModel.nameStr = device.alias;
    _detailModel.isPossessor = device.isPossessor;
    if (device.isColdTempProtection == false) {
        _detailModel.isColdTempProtection = NO;
    } else {
        _detailModel.isColdTempProtection = YES;
    }

    if (device.isPossessor == false) {
        _detailModel.isPossessor = NO;
    } else {
        _detailModel.isPossessor = YES;
    }
    _detailModel.userAccount = device.userAccount;
    _detailModel.ownAccount = device.ownAccount;
    
    if (_detailModel.powerSwitch == 1) {
        _detailModel.isShutDownOrNot = NO;
    } else {
        _detailModel.isShutDownOrNot = YES;
    }
    if (device.workMode == 3) {
        _detailModel.isTimeMode = YES;
    } else {
        _detailModel.isTimeMode = NO;
    }
    
    _detailModel.limitArr = LimitTempArr(_detailModel.tempSetLimitLown, _detailModel.tempSetLimitTop);
    return _detailModel;
//    self.detailView.model = _detailModel;
}
@end
